
<include file="layout/header" />
<style>
	.node {display:none}
	.fade-enter-active, .fade-leave-active {
		transition: opacity .5s
	}
	.fade-enter, .fade-leave-active {
		opacity: 0
	}
	.float-right label{
		float: right;
	}
	.float-right label span{
		color: darkred;
		font-size: 16px;
		line-height: 18px;
	}
	.contract{
		display: block;
		width:200px;
		height:260px;
	}
	.bigimg{
		display: block;
		width:400px;
		margin: 0 auto;
		height:600px;
	}
</style>

<div id="content">
	<div class="modal fade myModal" data-id="" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	    <div class="modal-dialog">
	        <div class="modal-content">
	            <div class="modal-header">
	                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
	                    &times;
	                </button>
	                <h4 class="modal-title">
	                    	合同
	                </h4>
	            </div>
	            <div class="modal-body" >
	               	<img :src="order.url" alt="" class="bigimg" />
	            </div>
	            <div class="modal-footer">
	                <button type="button" class="btn btn-primary" data-dismiss="modal">关闭
	                </button>
	            </div>
	        </div><!-- /.modal-content -->
	    </div><!-- /.modal -->
	</div>
	<section id="widget-grid" class="">
		<!-- START ROW -->

		<div class="row">

			<!-- NEW COL START -->
			<article class="col-sm-12 col-md-12 col-lg-6">

				<!-- Widget ID (each widget will need unique ID)-->
				<div class="jarviswidget" data-widget-colorbutton="false" data-widget-editbutton="false" data-widget-custombutton="false">

					<header>
						<header style="line-height: 35px;height: 100%;font-size: 16px;text-indent: 12px;">工程订单详情</header>
					</header>

					<!-- widget div-->
					<div>

						<!-- widget edit box -->
						<div class="jarviswidget-editbox">
							<!-- This area used as dropdown edit box -->
							
						</div>
						<!-- end widget edit box -->

						<!-- widget content -->
						<div class="widget-body no-padding">

							<form class="smart-form" id="oinfos">
								<header>用户信息</header>
								<fieldset>
									<section>
										<label class="label">申请人</label>
										<label class="input">
											<input type="text"   :value="create.name" class="input-sm" disabled="disabled">
										</label>										
									</section>									
									<section>
										<label class="label">申请人职务</label>
										<label class="input">
											<input type="text" :value="create.duty" disabled="disabled">
										</label>
									</section>
									<section>
										<label class="label">负责人</label>
										<label class="input">
											<input type="text"   :value="charge.name" class="input-sm" disabled="disabled">
										</label>										
									</section>									
									<section>
										<label class="label">负责人职务</label>
										<label class="input">
											<input type="text" :value="charge.duty" disabled="disabled">
										</label>
									</section>
									<section>
										<label class="label">下单时间</label>
										<label class="input">
											<input type="text"  :value="order.time | timetrans(1)" disabled="disabled">
										</label>
									</section>

									
								</fieldset>
								<header>详情</header>
								<fieldset>
									<table id="dt_basic" class="table table-striped table-bordered table-hover dataTable" aria-describedby="dt_basic_info">
                                     
                                        <tbody role="alert" aria-live="polite">                                           
                                            <tr class="odd" bid="">
                                                <td>项目名称</td>
                                                <td>{{order.name}}</td>
                                              
                                            </tr>
                                            <tr class="odd" bid="">
                                                <td>金额</td>
                                                <td>￥{{order.acamount}}</td>
                                               
                                            </tr>
                                            <tr class="odd" bid="">
                                                <td>周期</td>
                                                <td>{{order.cycles}}</td>
                                               
                                            </tr>
                                            <tr class="odd" bid="">
                                                <td>合同</td>
                                                <td><img :src="order.url" class="contract" @click="showBigimg"  alt="" /></td>                                                
                                            </tr>
                                            <tr class="odd" bid="">
                                                <td>详细描述</td>
                                                <td>{{order.content}}</td>                                               
                                            </tr>
                                            <tr class="odd" bid="">
                                                <td>备注</td>
                                                <td>{{order.remarks}}</td>                                               
                                            </tr>
                                        </tbody>
                                  </table>																											
									
								</fieldset>
								<header>审核信息</header>
								<fieldset>
									<section v-if="!noteshow">
										<label class="label">审核阶段</label>
										<label class="input">
											<input type="text" :value="jury.curStep+'/'+jury.steps" class="input-sm" disabled="disabled">
										</label>
									</section>
									<section>
										<label class="label">审核人</label>
										<label class="input">
											<input type="text" :value="juryMan.name" class="input-sm" disabled="disabled">
										</label>
									</section>
									<section>
										<label class="label">审核人职务</label>
										<label class="input">
											<input type="text" :value="juryMan.duty" class="input-sm" disabled="disabled">
										</label>
									</section>									
									<section  v-if="noteshow">
										<label class="label">评语</label>
										<label class="textarea">
											<textarea rows="3" class="custom-scroll" disabled="disabled">{{juryMan.note}}</textarea>
										</label>
									</section>
									
									<section class="float-right">
										<label class="input">
											<span>{{result}}</span>
										</label>
										<label class="label">结果：</label>										
									</section>
								</fieldset>								
								<footer>									
									<button type="button" class="btn btn-default" onclick="window.history.back();">
										返回
									</button>
								</footer>
							</form>

						</div>
						<!-- end widget content -->

					</div>
					<!-- end widget div -->

				</div>
				<!-- end widget -->
			</article>
		</div>

		<!-- END ROW -->

	</section>

</div>

<include file="layout/footer" />
<script>
	var vm=new Vue({
		el:"#content",
		data(){
			return{
				base:[],
	        	charge:[],
	        	create:[],
	        	goods:[],
	        	order:[],
	        	jury:[],
	        	result:"",
	        	noteshow:true,
	        	juryMan:[]
			}
		},
		methods:{
			showBigimg(){
          		 $(".myModal").modal("show");  
          		
          	}
		},
		created(){
			var _this=this;
			var data;
			var str=location.href;
			var str=str.split("id/")[1];
			var id=str.split(".html")[0];
			var url="/index.php/manage/Affairengineering/orderDetailData";
			$.post(url,{id:id},function(data){
	    		var data = JSON.parse(data);
        		if(data.status==1){        		
        			var data=data.data;
        			_this.base=data.base;
        			_this.charge=_this.base.charge;
        			_this.create=_this.base.create;
        			_this.jury=data.jury;
        			_this.juryMan=data.jury.juryMan;
        			//y
        			var order=data.order;
        			console.log(data)
        			_this.order=order;
//      			_this.goods=order.goods;
        			if(_this.jury.type==-1){
        				_this.result="处理中";
        				_this.noteshow=false;
        			}else if(_this.jury.type==0){
        				_this.result="未通过";
        			}else if(_this.jury.type==1){
        				_this.result="通过";
        			}
        		}
	    	})
        },
	})
	Vue.filter("timetrans",function(date,type){
        var date = new Date(date*1000);//如果date为10位不需要乘1000
        var Y = date.getFullYear();
        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1);
        var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate());
        var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours());
        var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes());
        var s = (date.getSeconds() <10 ? '0' + date.getSeconds() : date.getSeconds());        
        if(type==1){
          return Y+"/"+M+"/"+D+" "+h+":"+m+":"+s;
        }else if(type==2){
          return Y+"/"+M+"/"+D;
        } else if(type==3){
          return M+"/"+D+" "+h+":"+m;
        }     
      });
</script>





















